from fastapi import Request, APIRouter
from fastapi.responses import HTMLResponse, FileResponse

# 创建路由实例
router = APIRouter(tags=["前端视图"])


@router.get("/chat", response_class=HTMLResponse)
async def chat_index_view(request: Request):
    """
    聊天主页面
    """
    return FileResponse("templates/chat/index.html")


@router.get("/chat/{consultation_id}", response_class=HTMLResponse)
async def consultation_detail_view(request: Request, consultation_id: str):
    """
    问诊详情页面
    """
    # 参数将通过URL传递给前端，前端JavaScript可以从URL中获取consultation_id
    return FileResponse("templates/chat/index.html")